<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title>解锁你的生命数字</title>
		<script src="{:config('public.static')}/home/js/base.js"></script>
		<link rel="stylesheet" href="{:config('public.static')}/home/css/base.css" />
		<link rel="stylesheet" href="{:config('public.static')}/home/css/index.css" />

	</head>
	<body>
		<div class="bg" style="position:fixed; width:100%; height:100%; z-index:-1">
			<img src="{:config('public.static')}/home/img/bg3.png" height="100%" width="100%" />
		</div>
		<form class="life" action="">
			<div class="name">
				<label>姓名：</label>
				<input class="nameInput username" type="text" name="name"  size="" maxlength="8" value="" placeholder="请输入姓名" />
			</div>
			<div class="data">
				<label>生日：</label>
				<input class="dataInput birthday" type="text" name="birthday"  size="" maxlength="" value="" placeholder="例：20180808(阳历)" />
			</div>
			<button class="determine btn-sub">点击生成</button>
		</form>
		<div id="every" class="every" style="display: block;">
			<p>每个人都有一座金矿，也拥有一个丰盛的人生，每个人拥有自己的专属数字，你人生的所有奥秘就蕴藏在这几个数字当中!!</p>
		</div>
	</body>
</html>
<script src="{:config('public.static')}/ace1.4/assets/js/jquery-2.1.4.min.js"></script>
<!--<script src="{:config('public.static')}/home/js/layer.js"></script>-->
<script>
    document.body.style.height = window.screen.availHeight;
    var height = document.getElementById("every")
    if(document.body.style.height < 1000) {
        height.style.display = 'none';
    }
    $('.btn-sub').click(function(){
        var name = $('.username').val();
        var birthday = $('.birthday').val();
        if(name == '' || birthday == ''){
            alert('信息不能为空');
            return false;
        }
        $.ajax({
            url:'decrypt',
            type:"post",
            data:{name:name,birthday:birthday},
            dataType:'json',
            success:function(res){
                if(res.status == 1) {
                    switch(res.data.num){
                        case 1:
                            location.href = './one';
                            break;
                        case 2:
                            location.href = './two';
                            break;
                        case 3:
                            location.href = './three';
                            break;
                        case 4:
                            location.href = './four';
                            break;
                        case 5:
                            location.href = './five';
                            break;
                        case 6:
                            location.href = './six';
                            break;
                        case 7:
                            location.href = './seven';
                            break;
                        case 8:
                            location.href = './eight';
                            break;
                        case 9:
                            location.href = './nine';
                            break;
                        default :
                            alert(res.data.name +'没有结果！出错');
                            break;
                    }
                }else if(res.status == 0){
                   	alert(res.msg);
                   	location.reload();
                }
            }
        })
        return false;
    })
</script>